import React from "react";
import { Input } from "antd";

const UpperInput = ({ ...rest }) => {
  const handleKeyPress = e => {
    let start = e.target.selectionStart;
    let end = e.target.selectionEnd;
    e.target.value = e.target.value.toUpperCase();
    e.target.setSelectionRange(start, end);
  };
  return <Input {...rest} onKeyPress={handleKeyPress} />;
};

export default UpperInput;
